/* eslint-disable import/no-extraneous-dependencies */
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import { babel } from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import cleanup from 'rollup-plugin-cleanup';

export default {
  input: './src/index.ts',
  plugins: [
    resolve(),
    commonjs(),
    typescript({ tsconfig: './tsconfig.rollup.json' }),
    babel({ babelHelpers: 'bundled' }),
    terser(),
    cleanup(),
  ],
  output: [
    {
      file: 'dist/qx-util.system.js',
      format: 'system',
    },
    {
      file: 'dist/qx-util.umd.js',
      name: 'QXUtil',
      format: 'umd',
    },
    {
      file: 'dist/qx-util.cjs.js',
      format: 'cjs',
    },
    {
      file: 'dist/qx-util.amd.js',
      format: 'amd',
    },
    {
      file: 'dist/qx-util.esm.js',
      format: 'esm',
    },
  ],
};
